<% if flash[:error] %><div><%= flash[:error] %></div><% end %>

<div class="post2-container">
  <div class="back-to-all-ads">
    <%=link_to image_tag("back-to-ads2.jpg",:border=>"0"),:action=>"recently_posted_ads"-%><br /><br />
  </div>
   <% form_remote_for :edit_advertisment, @advertisment, :url => {:controller => "login",  :action => "edit_ad" }, :update=>"my-ads-listings-"+@advertisment.id.to_s , :html => { :multipart => true } do |edit_ad| -%>
      <%= hidden_field_tag(:advertisment_record_id,@advertisment.id) -%>
    <div class="post-left-column">
        <div class="post2-inner">
            <div class="post-ad-title">
                <div>  Title       :</div>
                <div> <%= edit_ad.text_field  :title ,:size => 40 , :onfocus=>"show_sample_text('title');" , :onblur=>"hide_sample_text('title');" , :onkeyup=>"document.getElementById('count').innerHTML = this.value.length;",:value=> @advertisment.title%>
                   <span id="title"class="sampletext"><%=  $sample_text["title"] %></span>
                </div>
              <div class="post-ad-title-max">min 20 and max 100 charachters(<span id="count">0</span>/100)</div>
            </div>


            <div class="post-ad-details">
              <div>  Description : </div>
              <div> <%= edit_ad.text_area  :description , :size => "50x7"  , :onfocus=>"show_sample_text('description');" , :onblur=>"hide_sample_text('description');",:onkeyup=>"document.getElementById('count2').innerHTML = this.value.length;",:value=> @advertisment.description %>
                <span id="description"class="sampletext"><%=  $sample_text["description"] %></span>
              </div>
              <div class="post-ad-details-max">min 40 and max 1000 charachters(<span id="count2">0</span>/1000)</div>
            </div>

            <div class="room-details">
              <div>Location :</div>
              <div> <%= edit_ad.text_field  :location , :size => 20 , :onfocus=>"show_sample_text('location');" , :onblur=>"hide_sample_text('location');",:value=>@advertisment.location%>
                <span id="location"class="sampletext"><%=  $sample_text["location"] %></span>
              </div>
            </div>
            <div style="clear:both;margin:10px 30px 10px 10px">
                <%@sub_category.advertisment_form_field.each do |form_field| -%>
                  <div>
                    <%=form_field[:label]-%> :
                  </div>
                  <div style="clear:both;">
                    <%=send(form_field[:input_type][0], "advertisment_attributes[#{form_field[:input_type][1]}]", form_field[:input_type][2])-%>
                  </div>
                <br />
                <%end -%>
            </div>

            <div class="upload-photos">
              <div>Upload Photos</div>
              <div class="upload-photos-input">
                 <%=file_field(:upload,:file1) -%>
                 <%=file_field(:upload,:file2) -%>
                 <%=file_field(:upload,:file3) -%>
                 <%=file_field(:upload,:file4) -%>
              </div>
            </div>

        	<div class="proceed-button2">
               <%=image_submit_tag "proceed.jpg", :border=>"0", :width=>"68px", :height=>"24px"%>
            </div>

            <div class="verification-message2">
              <%=image_tag 'verification-message2.jpg', :width=>"190px", :height=>"64px", :border=>"0px" -%>
            </div>
        </div>
    </div>
    <%end -%>
</div>